export function timeFormat(timeStr, format) {
    if (!timeStr) return ''
    let time = new Date(timeStr)
    if (!format){
        return time.getFullYear() + '年' + (time.getMonth() + 1) + '月' + time.getDate() + '日'
    }
    if (format === 'yyyy-mm-dd') {
        return time.getFullYear() + '-' + (time.getMonth() + 1) + '-' + time.getDate()
    }
    if (format === 'yyyy-mm-dd hh:mm:ss') {
        return time.getFullYear() + '-' + (time.getMonth() + 1) + '-' + time.getDate() + ' ' + time.getHours() + ':' + time.getMinutes() + ':' + time.getSeconds()
    }
}
